using System;
using System.Collections;
using System.Collections.Generic;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace Microsoft.PowerShell.CmdletManagement
{
    public partial class CmdletDetailsControl : System.Windows.Controls.UserControl
    {
        public CmdletDetailsControl()
        {
            InitializeComponent();
        }

        protected override void OnRender(DrawingContext drawingContext)
        {
            CmdletDesignerUtils.DisableAllCustomControls(this);

            if (CmdletDesignerUtils.IsInRole(PsSpecProjectRole.SpecWriter, Application.Current))
            {
                Snapin.IsReadOnly = false;
                SupportsShouldProcess.IsReadOnly = false;
                DefaultParameterSetName.IsReadOnly = false;
                TeamMembers.IsReadOnly = false;
                Status.IsReadOnly = false;
                LongDescription.IsReadOnly = false;
                Notes.IsReadOnly = false;
                InputObject.IsReadOnly = false;
                OutputObject.IsReadOnly = false;
                OutputObjectDescription.IsReadOnly = false;
                RelatedTo.IsReadOnly = false;
                Custom1.IsReadOnly = false;
                Custom2.IsReadOnly = false;
                Custom3.IsReadOnly = false;
                Custom4.IsReadOnly = false;
            }

            if (CmdletDesignerUtils.IsInRole(PsSpecProjectRole.HelpWriter, Application.Current))
            {
                HelpStatus.IsReadOnly = false;
                HelpLongDescription.IsReadOnly = false;
                HelpNotes.IsReadOnly = false;
                InputObject.IsReadOnly = false;
                OutputObject.IsReadOnly = false;
                InputObjectDescription.IsReadOnly = false;
                HelpOutputObjectDescription.IsReadOnly = false;
                RelatedTo.IsReadOnly = false;
            }

            base.OnRender(drawingContext);
        }
    }
}